<template lang="pug">
yd-cell-group
  yd-cell-item(v-for="staff in staffs", :key="staff.bid", type='div',arrow,@click.native="appointment(staff)")
      span(slot='left') {{staff.bname}}
</template>
<script>
import { mapMutations } from "vuex";
export default {
  data() {
    return {
      staffs: []
    };
  },
  created() {
    this.getData();
  },
  methods: {
    ...mapMutations(["selectStaff"]),
    getData() {
      this.$api.v1
        .common_storeStaffs_post({ data: { sid: window.data.sid } })
        .then(resp => {
          this.staffs = resp.data.data;
        });
    },
    appointment(staff) {
      this.selectStaff(staff);
      this.$router.push("/appointment");
    }
  }
};
</script>

<style lang="stylus">
.yd-list-theme1 {
  .yd-list-img {
    padding: 0;
    height: 2.625rem;

    img {
      margin-top: 0;
    }
  }

  .yd-list-mes {
    height: 0.7rem;
  }
}
</style>